package com.topone.Utils.wx.config;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.stereotype.Component;


@Component
@PropertySources({
        @PropertySource("classpath:wechat.mp.properties"),
        @PropertySource(value = "classpath:wechat.dev.mp.properties", ignoreResourceNotFound = true)
})
public class WechatMpProperties {

    protected final Logger LOG = LoggerFactory.getLogger(getClass());
    /**
     * 设置微信公众号的appid
     */
    @Value("${appId}")
    private String appId;

    /**
     * 设置微信公众号的app secret
     */
    @Value("${secret}")
    private String secret;

    /**
     * 设置微信公众号的token
     */
    @Value("${token}")
    private String token;

    /**
     * 设置微信公众号的EncodingAESKey
     */
    @Value("${aesKey}")
    private String aesKey;


    /**
     * 设置商户号
     */
    @Value("${mchId}")
    private String mchId;

    /**
     * 支付API密钥
     */
    @Value("${mchKey}")
    private String mchKey;

    /**
     * 支付API证书路径
     */
    @Value("${keyPath}")
    private String keyPath;
    /**
     * 支付结果后的异步通知地址
     */
    @Value("${notifyUrl}")
    private String notifyUrl;



    public String getAppId() {
        return this.appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getSecret() {
        return this.secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getMchKey() {
        return mchKey;
    }

    public void setMchKey(String mchKey) {
        this.mchKey = mchKey;
    }

    public String getKeyPath() {
        return keyPath;
    }

    public void setKeyPath(String keyPath) {
        this.keyPath = keyPath;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getAesKey() {
        return aesKey;
    }

    public void setAesKey(String aesKey) {
        this.aesKey = aesKey;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }
}
